#ifndef EDITPUNISHMENTS_H
#define EDITPUNISHMENTS_H

#include <QDialog>
#include <QtGui/QMessageBox>

#include <QtSql/QSqlQuery>
#include <QtSql/QSqlRecord>
#include <QtSql/QSqlTableModel>

namespace Ui {
class EditPunishments;
}

enum {
    Students_ID      = 0,
    Students_Number  = 1,
    Students_Class   = 2,
    Students_Name    = 3,
    Students_Sentry1 = 4,
    Students_Sentry2 = 5,
    Students_Sentry3 = 6,
    Students_Sentry4 = 7,
    Students_SentryT = 8,
    Students_SentryP = 9
};

class EditPunishments : public QDialog
{
    Q_OBJECT
    
public:
    explicit EditPunishments(QWidget *parent = 0);
    ~EditPunishments();
    
private slots:
    void on_tableView_pressed(const QModelIndex &index);

    void updateTableView();
    void decreaseSentry();
    void increaseSentry();

private:
    Ui::EditPunishments *ui;
    QSqlQuery query;
    QModelIndex curIndex;
    QSqlTableModel *tableModel;

    void loadView();
    void setupComboBox();
    void setActionsEnabled(bool _bool);
};

#endif // EDITPUNISHMENTS_H
